    $(document).ready(function(){
	//	removeBlocks();
		replaceObjects();
	});
	function removeBlocks(){
		var content = $('div.l-content');
		if(content.length){
			$('head script').remove()
			var body = $('body');
			
			body.css({"background":"none", "font-size":"14px", "padding":"10px"});
			content.css({"background": "transparent", "margin": "0 auto", "float" : "none", "padding": "0", "overflow":"hidden"});
			content.find('h1').css({"font-size":"200%"});
			$('div.b-content-footer').css({"overflow":"hidden", "width": "100%"});
			$('div.b-content-footer div').remove();
			$("div.b-background-basic").remove();
			var news = content.clone();
			body.find('*').remove();
			body.append(news);
			
			
			
		}
	}
	function replaceObjects(){
		$("object").each(function(){
			var item = $(this);
			var holder = $("<div class='video'>").insertBefore(item).css({"text-align":"center"});
			$("<span>").text("Video").css({"color":"red", "width": "100%", "display":"block"}).appendTo(holder);
			var id = linkifyYouTubeURLs(item.attr("data"));
			
			var imgPrev = $("<img/>").attr({"class": "video-prev"}).css({"display":"block", "width":"480px", "height":"360px"});
			
			$.getJSON("http://gdata.youtube.com/feeds/api/videos/" + id +"?v=2&alt=jsonc&callback=?", function(json){
				$("<a/>").attr({"class": "video-link", "href" :item.attr("data")}).css({"display":"inline-block", "position" : "relative"}).
				append(imgPrev.attr({"src": json.data.thumbnail.hqDefault})).
				
				appendTo(holder);
			});
		});
		$("object").remove();
	}
	
	function linkifyYouTubeURLs(text) {
    /* Commented regex (in PHP syntax)
    $text = preg_replace('%
        # Match any youtube URL in the wild.
        (?:https?://)?   # Optional scheme. Either http or https
        (?:www\.)?       # Optional www subdomain
        (?:              # Group host alternatives
          youtu\.be/     # Either youtu.be,
        | youtube\.com   # or youtube.com
          (?:            # Group path alternatives
            /embed/      # Either /embed/
          | /v/          # or /v/
          | /watch\?v=   # or /watch\?v=
          )              # End path alternatives.
        )                # End host alternatives.
        ([\w\-]{10,12})  # $1: Allow 10-12 for 11 char youtube id.
        \b               # Anchor end to word boundary.
        [?=&\w]*         # Consume any URL (query) remainder.
        (?!              # But don\'t match URLs already linked.
          [\'"][^<>]*>   # Not inside a start tag,
        | </a>           # or <a> element text contents.
        )                # End negative lookahead assertion.
        %ix', 
        '<a href="http://www.youtube.com/watch?v=$1">YouTube link: $1</a>',
        $text);
    */
    // Here is the same regex in JavaScript literal regexp syntax:
    return text.replace(
        /(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=))([\w\-]{10,12})\b[?=&\w]*(?!['"][^<>]*>|<\/a>)/ig,
        '$1');
	}